/*
 * XML Type:  XEvent
 * Namespace: http://www.seedwill.com/xul/widget/
 * Java type: com.seedwill.xul.widget.XEvent
 *
 * Automatically generated - do not modify.
 */
package com.seedwill.xul.widget.impl;
/**
 * An XML XEvent(@http://www.seedwill.com/xul/widget/).
 *
 * This is a complex type.
 */
public class XEventImpl extends com.seedwill.xul.core.impl.XIdentifiedImpl implements com.seedwill.xul.widget.XEvent
{
    private static final long serialVersionUID = 1L;
    
    public XEventImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName TYPE$0 = 
        new javax.xml.namespace.QName("", "type");
    private static final javax.xml.namespace.QName SRC$2 = 
        new javax.xml.namespace.QName("", "src");
    private static final javax.xml.namespace.QName LOCATION$4 = 
        new javax.xml.namespace.QName("", "location");
    private static final javax.xml.namespace.QName DELEGATE$6 = 
        new javax.xml.namespace.QName("", "delegate");
    
    
    /**
     * Gets the "type" element
     */
    public java.lang.String getType()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TYPE$0, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "type" element
     */
    public org.apache.xmlbeans.XmlString xgetType()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(TYPE$0, 0);
            return target;
        }
    }
    
    /**
     * Sets the "type" element
     */
    public void setType(java.lang.String type)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TYPE$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(TYPE$0);
            }
            target.setStringValue(type);
        }
    }
    
    /**
     * Sets (as xml) the "type" element
     */
    public void xsetType(org.apache.xmlbeans.XmlString type)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(TYPE$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(TYPE$0);
            }
            target.set(type);
        }
    }
    
    /**
     * Gets the "src" element
     */
    public com.seedwill.xul.widget.XControl getSrc()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XControl target = null;
            target = (com.seedwill.xul.widget.XControl)get_store().find_element_user(SRC$2, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "src" element
     */
    public boolean isSetSrc()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(SRC$2) != 0;
        }
    }
    
    /**
     * Sets the "src" element
     */
    public void setSrc(com.seedwill.xul.widget.XControl src)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XControl target = null;
            target = (com.seedwill.xul.widget.XControl)get_store().find_element_user(SRC$2, 0);
            if (target == null)
            {
                target = (com.seedwill.xul.widget.XControl)get_store().add_element_user(SRC$2);
            }
            target.set(src);
        }
    }
    
    /**
     * Appends and returns a new empty "src" element
     */
    public com.seedwill.xul.widget.XControl addNewSrc()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XControl target = null;
            target = (com.seedwill.xul.widget.XControl)get_store().add_element_user(SRC$2);
            return target;
        }
    }
    
    /**
     * Unsets the "src" element
     */
    public void unsetSrc()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(SRC$2, 0);
        }
    }
    
    /**
     * Gets the "location" element
     */
    public com.seedwill.xul.core.XLocation getLocation()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XLocation target = null;
            target = (com.seedwill.xul.core.XLocation)get_store().find_element_user(LOCATION$4, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "location" element
     */
    public boolean isSetLocation()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(LOCATION$4) != 0;
        }
    }
    
    /**
     * Sets the "location" element
     */
    public void setLocation(com.seedwill.xul.core.XLocation location)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XLocation target = null;
            target = (com.seedwill.xul.core.XLocation)get_store().find_element_user(LOCATION$4, 0);
            if (target == null)
            {
                target = (com.seedwill.xul.core.XLocation)get_store().add_element_user(LOCATION$4);
            }
            target.set(location);
        }
    }
    
    /**
     * Appends and returns a new empty "location" element
     */
    public com.seedwill.xul.core.XLocation addNewLocation()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XLocation target = null;
            target = (com.seedwill.xul.core.XLocation)get_store().add_element_user(LOCATION$4);
            return target;
        }
    }
    
    /**
     * Unsets the "location" element
     */
    public void unsetLocation()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(LOCATION$4, 0);
        }
    }
    
    /**
     * Gets the "delegate" element
     */
    public com.seedwill.xul.widget.XEventDelegate getDelegate()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XEventDelegate target = null;
            target = (com.seedwill.xul.widget.XEventDelegate)get_store().find_element_user(DELEGATE$6, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "delegate" element
     */
    public boolean isSetDelegate()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(DELEGATE$6) != 0;
        }
    }
    
    /**
     * Sets the "delegate" element
     */
    public void setDelegate(com.seedwill.xul.widget.XEventDelegate delegate)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XEventDelegate target = null;
            target = (com.seedwill.xul.widget.XEventDelegate)get_store().find_element_user(DELEGATE$6, 0);
            if (target == null)
            {
                target = (com.seedwill.xul.widget.XEventDelegate)get_store().add_element_user(DELEGATE$6);
            }
            target.set(delegate);
        }
    }
    
    /**
     * Appends and returns a new empty "delegate" element
     */
    public com.seedwill.xul.widget.XEventDelegate addNewDelegate()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XEventDelegate target = null;
            target = (com.seedwill.xul.widget.XEventDelegate)get_store().add_element_user(DELEGATE$6);
            return target;
        }
    }
    
    /**
     * Unsets the "delegate" element
     */
    public void unsetDelegate()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(DELEGATE$6, 0);
        }
    }
}
